package business;
import java.io.Serializable;

import model.AcessoUsuario;

import org.hibernate.Session;
import org.hibernate.Transaction;

import util.HibernateUtil;

public class AcessoUsuarioDAO implements Serializable{
	private static final long serialVersionUID = -3487035138316857485L;
	static AcessoUsuarioDAO instance;
	
	public static AcessoUsuarioDAO getInstance()
	{
		if(instance == null)
			instance = new AcessoUsuarioDAO();
		return instance;
	}
	
	public AcessoUsuarioDAO() {
	}
	
	public AcessoUsuario get(String login) {		
		Session session = HibernateUtil.getSession();
		Transaction tr = session.beginTransaction();
		
		AcessoUsuario acessoUsuario  = (AcessoUsuario) session.get(AcessoUsuario.class,login);		
		tr.commit();
		
		return acessoUsuario;
	}
}